package com.wn.consumer;

import org.springframework.amqp.rabbit.annotation.Queue;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

/**
 * @author yellow Docter
 * @date 2023 -07-25
 * @desc
 */
@Component
public class Consumer01 {

    /**
     *  @RabbitListener 监听 mq
     *        queuesToDeclare 监听那个队列
     *        @Queue(name = "hello-queue")
     *
     * @param msg
     */
    @RabbitListener(queuesToDeclare = @Queue(name = "hello-queue"))
    public void consumer(String msg){

        System.out.println("消费者消费了消息是:====>" + msg);

    }

}
